﻿// -----------------------------------------------------------------------
// <copyright file="PathHelper.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace MT4Trainer.PathHelper
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Text;

    /// <summary>
    /// Gets various paths.
    /// </summary>
    public class PathHelper
    {
        #region path helper

        public static String GetHomeDir()
        {
            return Environment.GetEnvironmentVariable("USERPROFILE");
        }

        public static String GetMyDocumentsDir()
        {
            return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
        }

        public static String GetEnvTempDir()
        {
            return Environment.GetEnvironmentVariable("TEMP");
        }

        public static String GetTempDir()
        {
            return System.IO.Path.GetTempPath();
        }
        #region Methods

        static public string AssemblyDirectory
        {
            get
            {

                string codeBase = Assembly.GetExecutingAssembly().CodeBase;
                UriBuilder uri = new UriBuilder(codeBase);
                string path = Uri.UnescapeDataString(uri.Path);
                return Path.GetDirectoryName(path);
            }
        }
        #endregion
        #endregion
    }
}
